using System.Collections.Generic;

using Xc.DataAccess.AepCoapCore.Models.Apis.Core;

namespace Xc.DataAccess.AepCoapCore.Models.Apis
{
    class Aep_rule_engine
    {
        //参数body: 类型json, 参数不可以为空
        //  描述:body,具体参考平台api说明
        public static string saasCreateRule(string appKey, string appSecret, string body)
        {
            string path = "/Aep_rule_engine/api/v2/rule/sass/createRule";
            Dictionary<string, string> headers = null;
            Dictionary<string, string> param = null;
            string version = "20200111000503";

            string application = appKey;
            string key = appSecret;


            string response = AepHttpRequest.SendAepHttpRequest(path, headers, param, body, version, application, null, key, "POST");
            if (response != null)
                return response;
            return null;
        }
        //参数ruleId: 类型String, 参数可以为空
        //  描述:
        //参数productId: 类型String, 参数可以为空
        //  描述:
        //参数pageNow: 类型long, 参数可以为空
        //  描述:
        //参数pageSize: 类型long, 参数可以为空
        //  描述:
        public static string saasQueryRule(string appKey, string appSecret, string ruleId = "", string productId = "", string pageNow = "", string pageSize = "")
        {
            string path = "/Aep_rule_engine/api/v2/rule/sass/queryRule";
            Dictionary<string, string> headers = null;
            Dictionary<string, string> param = new Dictionary<string, string>();
            param.Add("ruleId", ruleId);
            param.Add("productId", productId);
            param.Add("pageNow", pageNow);
            param.Add("pageSize", pageSize);

            string version = "20200111000633";

            string application = appKey;
            string key = appSecret;


            string response = AepHttpRequest.SendAepHttpRequest(path, headers, param, null, version, application, null, key, "GET");
            if (response != null)
                return response;
            return null;
        }
        //参数body: 类型json, 参数不可以为空
        //  描述:body,具体参考平台api说明
        public static string saasUpdateRule(string appKey, string appSecret, string body)
        {
            string path = "/Aep_rule_engine/api/v2/rule/sass/updateRule";
            Dictionary<string, string> headers = null;
            Dictionary<string, string> param = null;
            string version = "20200111000540";

            string application = appKey;
            string key = appSecret;


            string response = AepHttpRequest.SendAepHttpRequest(path, headers, param, body, version, application, null, key, "POST");
            if (response != null)
                return response;
            return null;
        }
        //参数body: 类型json, 参数不可以为空
        //  描述:body,具体参考平台api说明
        public static string saasDeleteRuleEngine(string appKey, string appSecret, string body)
        {
            string path = "/Aep_rule_engine/api/v2/rule/sass/deleteRule";
            Dictionary<string, string> headers = null;
            Dictionary<string, string> param = null;
            string version = "20200111000611";

            string application = appKey;
            string key = appSecret;


            string response = AepHttpRequest.SendAepHttpRequest(path, headers, param, body, version, application, null, key, "POST");
            if (response != null)
                return response;
            return null;
        }

    }
}
